package ro.isdc.vms.vehicleinstance.domain;

import java.util.Date;

import ro.isdc.vms.misc.domain.ValueObject;
import ro.isdc.vms.party.domain.Party;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 * Represents the registration of a vehicle instance for the specific undertaking 
 * of one or more business activities/purpose (i.e. advertising). A vehicle registration 
 * represents a relationship between the company and a party playing specific roles, 
 * with respect to a vehicle instance.
 * 
 * @author Andrei Chirila
 */
public class VehicleRegistration extends ValueObject {
	
	/**
	 * Generated Serial Version UID
	 */
	private static final long serialVersionUID = 7890616173378554904L;

	/**
	 * Determines whether the registerer is the owner of the vehicle at the time
	 * of the registration.
	 */
	private boolean isRegistererVehicleOwner;

	/**
	 * The party where the vehicle is located.
	 */
	private Party locationParty;
	
	/**
	 * The registering party internal id.
	 */
	private Party registererParty;
	
	/**
	 * Registration date
	 */
	private Date registrationDate;

	/**
	 * @return the isRegistererVehicleOwner
	 */
	public boolean isRegistererVehicleOwner() {
		return isRegistererVehicleOwner;
	}

	/**
	 * @param isRegistererVehicleOwner the isRegistererVehicleOwner to set
	 */
	public void setRegistererVehicleOwner(boolean isRegistererVehicleOwner) {
		this.isRegistererVehicleOwner = isRegistererVehicleOwner;
	}

	/**
	 * @return the locationParty
	 */
	public Party getLocationParty() {
		return locationParty;
	}

	/**
	 * @param locationParty the locationParty to set
	 */
	public void setLocationParty(final Party locationParty) {
		this.locationParty = locationParty;
	}

	/**
	 * @return the registererParty
	 */
	public Party getRegistererParty() {
		return registererParty;
	}

	/**
	 * @param registererParty the registererParty to set
	 */
	public void setRegistererParty(final Party registererParty) {
		this.registererParty = registererParty;
	}

	/**
	 * @return the registrationDate
	 */
	public Date getRegistrationDate() {
		return registrationDate;
	}

	/**
	 * @param registrationDate the registrationDate to set
	 */
	public void setRegistrationDate(final Date registrationDate) {
		this.registrationDate = registrationDate;
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE).append(
				"registrationDate", this.registrationDate).append(
				"registererParty", this.registererParty).append(
				"registererVehicleOwner", this.isRegistererVehicleOwner())
				.append("locationParty", this.locationParty).toString();
	}
	
}
